﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using InformationSystem.BLL.Core.Model;

namespace InformationSystem.BLL.Core.Service
{
    public interface IInformationService
    {
        bool SendMail(Mail mail);
        bool SaveMail(Mail mail);
        IList<Mail> GetMailSendList(string sendUserID);
        IList<Mail> GetMailRecvList(string recvuserID);
        IList<Mail> GetMailDraftList(string senduserID);
        bool DeleteMailSent(int mailID, string senduserid, string appRunPath);
        bool DeleteMailRecvd(int mailID, string recvuserid);
        Mail GetMailDetailByID(int mailID, string userid);
        Attachment GetMailAttachment(int mailid, int fileid);

        /// <summary>
        /// 获取当前用户未读邮件数
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        int GetMailUnreadCount(LoginUser user);

        bool SendAffiche(Affiche affiche);
        bool DeleteAfficheByID(int afficheID, string userid, string path);
       

        /// <summary>
        /// 返回接收到的公告
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        IList<Affiche> GetRecvAfficheList(LoginUser user, int recordcount);

        /// <summary>
        /// 返回发送的公告
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        IList<Affiche> GetSentAfficheList(LoginUser user);

        /// <summary>
        /// 返回阅读过此公告的用户
        /// </summary>
        /// <param name="afficheid"></param>
        /// <returns></returns>
        IList<RecvUser> GetAfficheReadList(int afficheid);
        Affiche GetAffiche(int afficheid, LoginUser user);
        Attachment GetAfficheAttachment(int afficheid, int fileid);

        /// <summary>
        /// 刷新某用户阅读过此公告
        /// </summary>
        /// <param name="afficheid"></param>
        /// <param name="user"></param>
        void UpdateAfficheUserReadStatus(int afficheid, LoginUser user);

        bool SendWorkInfo(WorkInfo workinfo);
        bool DeleteWorkInfoByID(int workInfoid, string userid, string path);

        /// <summary>
        /// 返回收到的就业信息
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        IList<WorkInfo> GetRecvWorkInfoList(LoginUser user, int recordcount);

        /// <summary>
        /// 返回发送过的就业信息
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        IList<WorkInfo> GetSentWorkInfoList(LoginUser user);

        /// <summary>
        /// 返回就业信息的信息内容
        /// </summary>
        /// <param name="workInfoid"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        WorkInfo GetWorkInfo(int workInfoid, LoginUser user);

        /// <summary>
        /// 获取读过此就业信息的用户
        /// </summary>
        /// <param name="afficheid"></param>
        /// <returns></returns>
        IList<RecvUser> GetWorkInfoReadList(int workinfoid);
        Attachment GetWorkInfoAttachment(int workInfoid, int fileid);
        /// <summary>
        /// 新增某用户读过此就业信息
        /// </summary>
        /// <param name="workInfoid"></param>
        /// <param name="user"></param>
        void UpdateWorkInfoUserReadStatus(int workInfoid, LoginUser user);

        /// <summary>
        /// 发送信息
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        bool SendMsg(Msg msg);

        /// <summary>
        /// 获取又自己发送的信息
        /// </summary>
        /// <param name="sendUserID"></param>
        /// <returns></returns>
        IList<Msg> GetMsgSendList(string sendUserID);

        /// <summary>
        /// 获取自己接收到的信息
        /// </summary>
        /// <param name="recvuserID"></param>
        /// <returns></returns>
        IList<Msg> GetMsgRecvList(string recvuserID, int recordcount);

        /// <summary>
        /// 删除自己发送过的某信息
        /// </summary>
        /// <param name="msgID"></param>
        /// <param name="senduserid"></param>
        /// <param name="appRunPath"></param>
        /// <returns></returns>
        bool DeleteMsgSent(int msgID, string senduserid, string appRunPath);

        /// <summary>
        /// 获取信息的完整内容
        /// </summary>
        /// <param name="msgID"></param>
        /// <param name="userid"></param>
        /// <returns></returns>
        Msg GetMsgDetailByID(int msgID, LoginUser user);

        /// <summary>
        /// 获取某信息的指定的附件
        /// </summary>
        /// <param name="msgid"></param>
        /// <param name="fileid"></param>
        /// <returns></returns>
        Attachment GetMsgAttachment(int msgid, int fileid);

        /// <summary>
        /// 获取已经阅读过此信息的用户列表
        /// </summary>
        /// <param name="msgid"></param>
        /// <returns></returns>
        IList<RecvUser> GetMsgReadList(int msgid);

        /// <summary>
        /// 获取未读过此信息的用户列表
        /// </summary>
        /// <param name="msgid"></param>
        /// <returns></returns>
        IList<RecvUser> GetMsgUnReadList(int msgid);

        /// <summary>
        /// 更新某用户读过该信息
        /// </summary>
        /// <param name="msgid"></param>
        /// <param name="userid"></param>
        void UpdateMsgUserReadStatusToRead(int msgid, string userid);

        bool ReplyMsg(int msgid, LoginUser user, string content);

        IList<MsgReplyInfo> GetMsgReplyInfoList(int msgid);

        int GetAfficheCountInGrade(LoginUser user);
    }
}
